const request = require("../utils/requst");
const mop = "/mop/api";
const scope = "mop";

const getwork = (data) =>
  request(mop, { scope, cmdCode: "WORK_GET", source: JSON.stringify(data) });
const postwork = (data) =>
  request(mop, { scope, cmdCode: "WORK_POST", source: data });
const work_list = (data) =>
  request(mop, {
    scope,
    cmdCode: "WORK_LIST",
    pageIndex: data.page,
    pageSize: data.size,
    source: data.data,
    reqCode: data.reqCode,
  });
const delwork = (data) =>
  request(mop, { scope, cmdCode: "WORK_DEL", source: JSON.stringify(data) });
const putwork = (data) =>
  request(mop, { scope, cmdCode: "WORK_PATCH", source: data });
const work_type = (data) =>
  request(mop, {
    scope,
    cmdCode: "WORK_TYPE_LIST",
  });
const postwork_type = (data) =>
  request(mop, {
    scope,
    cmdCode: "WORK_TYPE_POST",
    source: JSON.stringify(data),
  });
const delwork_type = (data) =>
  request(mop, {
    scope,
    cmdCode: "WORK_TYPE_DEL",
    source: JSON.stringify(data),
  });
const postwork_to = (data) =>
  request(mop, { scope, cmdCode: "WORK_TO_TYPE_POST", source: data });
const delwork_to = (data) =>
  request(mop, { scope, cmdCode: "WORK_TO_TYPE_DEL", source: data });
const getwork_to = (data) =>
  request(mop, { scope: "mop", cmdCode: "WORK_TO_TYPE_GET", source: data });
const applyList = (data) =>
  request(mop, {
    scope,
    cmdCode: "WORK_APPLY_LIST",
    pageIndex: data.page,
    // pageSize: data.size,
  });
const entrylist = (data) =>
  request(mop, {
    scope,
    cmdCode: "WORK_ENTRY_LIST",
    pageIndex: data.page,
    source: data.data,
  });
const Pentry = (data) =>
  request(mop, { scope, cmdCode: "WORK_ENTRY_PATCH", source: data });
const admin = (data) =>
  request(mop, {
    scope,
    cmdCode: "ADMIN_LIST",
    pageIndex: data.page,
  });
const addadmin = (data) =>
  request(mop, { scope, cmdCode: "ADMIN_POST", source: data });
const deladmin = (data) =>
  request(mop, { scope, cmdCode: "ADMIN_DEL", source: data });
const userpay = (data) =>
  request(mop, {
    scope,
    cmdCode: "USER_TRANSFER_MONEY",
    source: JSON.stringify(data),
  });
const userList = (data) =>
  request(mop, {
    scope,
    cmdCode: "USER_LIST",
    source: JSON.stringify(data.data),
    pageIndex: data.page,
    pageSize: data.size,
  });
const receuit = (data) =>
  request(mop, {
    scope,
    cmdCode: "WORK_RECRUIT_PATCH",
    source: JSON.stringify(data),
  });
const threeUser = (data) =>
  request(mop, {
    scope,
    cmdCode: "USER_LIST_ROLE_THREE",
    pageIndex: data.page,
  });
const threeAdd = (data) =>
  request(mop, {
    scope,
    cmdCode: "USER_PATCH_ROLE_THREE",
    source: JSON.stringify(data),
  });

const delThree = (data) =>
  request(mop, {
    scope,
    cmdCode: "USER_PATCH",
    source: JSON.stringify(data),
  });
module.exports = {
  delThree,
  threeAdd,
  threeUser,
  receuit,
  getwork,
  postwork,
  work_list,
  delwork,
  work_type,
  postwork_type,
  delwork_type,
  postwork_to,
  delwork_to,
  getwork_to,
  applyList,
  entrylist,
  Pentry,
  admin,
  addadmin,
  deladmin,
  userpay,
  userList,
  putwork,
};
